//
//  ZGSMainCell.m
//  MapleLeaf
//
//  Created by 邝子涵 on 15/12/4.
//  Copyright © 2015年 AntennaBabyTeam. All rights reserved.
//

#import "ZGSMainCell.h"

@implementation ZGSMainCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    self.contentView.backgroundColor = [UIColor colorWithRed:0.969f green:0.961f blue:0.973f alpha:1.00f];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.bgView = [[UIView alloc] init];
    self.bgView.backgroundColor = [UIColor whiteColor];
    self.bgView.layer.borderWidth = 1;
    self.bgView.layer.borderColor = [[UIColor colorWithRed:0.827f green:0.827f blue:0.827f alpha:1.00f] CGColor];
    self.bgView.layer.cornerRadius = 13;
    self.bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:self.bgView];

    
    self.leftImageView = [[UIImageView alloc] init];
    [self.bgView addSubview:self.leftImageView];

    
    self.rightImageView = [[UIImageView alloc] init];
    [self.bgView addSubview:self.rightImageView];

    
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    [self.bgView addSubview:self.titleLabel];


}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.bgView.frame = CGRectMake(10 * WIDTH / 375.0, 15, WIDTH - 20 * WIDTH / 375.0, 50 * HEIGHT / 667.0);
    self.leftImageView.frame = CGRectMake(10 * WIDTH / 375.0, 9 * HEIGHT / 667.0, 32 * WIDTH / 375.0, 32 * HEIGHT / 667.0);
    self.titleLabel.frame = CGRectMake(50 * WIDTH / 375.0, 15 * HEIGHT / 667.0, 100 * WIDTH / 375.0, 20 * HEIGHT / 667.0);
    self.rightImageView.frame = CGRectMake(WIDTH - 50 * WIDTH / 375.0, 17 * HEIGHT / 667.0, 18 * HEIGHT / 667.0, 18 * HEIGHT / 667.0);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
